import http from "@/utils/request";

//  获取所有商品库存信息的接口
export function getAllStockRequest (currentPage,pageSize) {
    return http({
        url:'/stock',
        method:'get',
        data:{},
        params:{currentPage,pageSize}
    })
}

//  添加商品库存信息的接口
export function addAllStockRequest (addAllStockData) {
    return http({
        url:'/stock',
        method:'post',
        data:addAllStockData
    })
}

//  根据id查询库存信息的接口
export function getStockByIdRequest (stockId) {
    return http({
        url:`/stock/${stockId}`,
        method:'get',
        data:{}
    })
}

//  添加商品库存信息的接口
export function updateStockRequest (updateStockData) {
    return http({
        url:'/stock',
        method:'put',
        data:updateStockData
    })
}

//  根据id删除库存信息的接口
export function deleteStockByIdRequest (stockId) {
    return http({
        url:`/stock/${stockId}`,
        method:'delete',
        data:{}
    })
}